Document required non-interactive theme flags - #8221
Merged
Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Jul 31, 2026
gonzaloriestra
force-pushed
the
gonzalo/noninteractive-flags-apps
branch
from
July 31, 2026 11:52
115a5c4 to
d5f5306
Compare
gonzaloriestra
force-pushed
the
gonzalo/noninteractive-flags-themes
branch
2 times, most recently
from
July 31, 2026 12:29
efdaeaa to
29024a4
Compare
gonzaloriestra
force-pushed
the
gonzalo/noninteractive-flags-apps
branch
from
July 31, 2026 12:29
d5f5306 to
21d1095
Compare
gonzaloriestra
marked this pull request as ready for review
July 31, 2026 14:09
gonzaloriestra
force-pushed
the
gonzalo/noninteractive-flags-apps
branch
from
July 31, 2026 14:15
21d1095 to
1722dd0
Compare
gonzaloriestra
force-pushed
the
gonzalo/noninteractive-flags-themes
branch
from
July 31, 2026 14:15
29024a4 to
bbd1f45
Compare
gonzaloriestra
force-pushed
the
gonzalo/noninteractive-flags-apps
branch
from
July 31, 2026 14:19
1722dd0 to
58b84a9
Compare
gonzaloriestra
force-pushed
the
gonzalo/noninteractive-flags-themes
branch
from
July 31, 2026 14:19
bbd1f45 to
2087d48
Compare
gonzaloriestra
force-pushed
the
gonzalo/noninteractive-flags-themes
branch
from
July 31, 2026 14:39
2087d48 to
852f6ce
Compare
graygilmore
approved these changes
Jul 31, 2026
gonzaloriestra
force-pushed
the
gonzalo/noninteractive-flags-apps
branch
from
August 3, 2026 12:24
58b84a9 to
b09db8f
Compare
gonzaloriestra
force-pushed
the
gonzalo/noninteractive-flags-themes
branch
from
August 3, 2026 12:24
852f6ce to
04a00c0
Compare
gonzaloriestra
force-pushed
the
gonzalo/noninteractive-flags-apps
branch
from
August 3, 2026 13:59
b09db8f to
d900837
Compare
gonzaloriestra
force-pushed
the
gonzalo/noninteractive-flags-themes
branch
from
August 3, 2026 13:59
04a00c0 to
c9f30e9
Compare
gonzaloriestra
force-pushed
the
gonzalo/noninteractive-flags-themes
branch
from
August 4, 2026 09:06
c9f30e9 to
77aa551
Compare
gonzaloriestra
force-pushed
the
gonzalo/noninteractive-flags-apps
branch
from
August 4, 2026 09:06
d900837 to
4c70839
Compare
Contributor
Differences in type declarationsWe detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:
New type declarationsWe found no new type declarations in this PR Existing type declarationspackages/cli-kit/dist/public/node/base-command.d.ts@@ -2,8 +2,15 @@ import { Command } from '@oclif/core';
import { OutputFlags, Input, ParserOutput, FlagInput, OutputArgs } from '@oclif/core/parser';
export type ArgOutput = OutputArgs<any>;
export type FlagOutput = OutputFlags<any>;
+export interface NonTTYFlagRequirement {
+ /** At least one of these flags must be present when the requirement applies. */
+ flags: string[];
+ /** Determines whether the requirement applies to the parsed flags. */
+ when?: (flags: FlagOutput) => boolean;
+}
declare abstract class BaseCommand extends Command {
static baseFlags: FlagInput<{}>;
+ static nonTTYFlagRequirements(_flags: FlagOutput): NonTTYFlagRequirement[];
static descriptionWithoutMarkdown(): string | undefined;
static analyticsNameOverride(): string | undefined;
static analyticsStopCommand(): string | undefined;
@@ -22,6 +29,8 @@ declare abstract class BaseCommand extends Command {
}>;
protected environmentsFilename(): string | undefined;
protected failMissingNonTTYFlags(flags: FlagOutput, requiredFlags: string[]): void;
+ private failMissingNonTTYFlagRequirements;
+ private applicableNonTTYFlagRequirements;
private resultWithEnvironment;
/**
* Tries to load an environment to forward to the command. If no environment
packages/cli-kit/dist/public/node/cli.d.ts@@ -55,6 +55,19 @@ export declare const portFlag: (options?: {
env?: string;
hidden?: boolean;
}) => import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
+/**
+ * Marks a flag as required when the CLI cannot prompt for a value.
+ *
+ * The flag remains optional in interactive terminals. In non-interactive environments,
+ * `BaseCommand` validates the flag automatically and the requirement is shown in `--help`.
+ * Use `BaseCommand.nonTTYFlagRequirements` for conditional or alternative requirements.
+ *
+ * @param flag - An oclif flag definition.
+ * @returns A new flag definition annotated for non-interactive validation and help output.
+ */
+export declare function requiredIfNonInteractive<TFlag extends {
+ description?: string;
+}>(flag: TFlag): TFlag;
/**
* Clear the CLI cache, used to store some API responses and handle notifications status
*/
|
isaacroldan
approved these changes
Aug 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Related: https://github.com/shop/issues-develop/issues/22928
Summary
Testing
See #8223